let fn = (...args) => {
  if (args.length >= 2) {
    return args.reduce((p, val) => p + val)
  } else {
    return (...arg) => fn(...args, ...arg)
  }
}

var a = fn(1)(2)
console.log(a);
